package com.itheima.map;

import java.util.*;

public class MapDemo03 {
    public static void main(String[] args) {
        Map<String,String> map = new HashMap<>();

        map.put("001","张三");
        map.put("002","李四");
        map.put("003","王五");
        map.put("004","赵六");

        Set<String> keySet = map.keySet();

        for (String key : keySet) {
            String value = map.get(key);
            System.out.println(key + "-----" +value);
        }

        Set<Map.Entry<String, String>> entries = map.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            System.out.println(entry.getKey() +"..."+entry.getValue());
        }

//        Output:
//        001-----张三
//        002-----李四
//        003-----王五
//        004-----赵六
//        001...张三
//        002...李四
//        003...王五
//        004...赵六
    }
}
